3.211 \(\int \frac{\tan ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx\)

Optimal. Leaf size=71 \[ -\frac{a^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 b^2 f (a-b)}-\frac{\log (\cos (e+f x))}{f (a-b)}+\frac{\tan ^2(e+f x)}{2 b f} \]

[Out]

-(Log[Cos[e + f*x]]/((a - b)*f)) - (a^2*Log[a + b*Tan[e + f*x]^2])/(2*(a - b)*b^2*f) + Tan[e + f*x]^2/(2*b*f)

________________________________________________________________________________________

Rubi [A]  time = 0.0993675, antiderivative size = 71, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 3, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.13, Rules used = {3670, 446, 72} \[ -\frac{a^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 b^2 f (a-b)}-\frac{\log (\cos (e+f x))}{f (a-b)}+\frac{\tan ^2(e+f x)}{2 b f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

-(Log[Cos[e + f*x]]/((a - b)*f)) - (a^2*Log[a + b*Tan[e + f*x]^2])/(2*(a - b)*b^2*f) + Tan[e + f*x]^2/(2*b*f)

Rule 3670

Int[((d_.)*tan[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*((c_.)*tan[(e_.) + (f_.)*(x_)])^(n_))^(p_.), x_Symbol]
 :> With[{ff = FreeFactors[Tan[e + f*x], x]}, Dist[(c*ff)/f, Subst[Int[(((d*ff*x)/c)^m*(a + b*(ff*x)^n)^p)/(c^
2 + ff^2*x^2), x], x, (c*Tan[e + f*x])/ff], x]] /; FreeQ[{a, b, c, d, e, f, m, n, p}, x] && (IGtQ[p, 0] || EqQ
[n, 2] || EqQ[n, 4] || (IntegerQ[p] && RationalQ[n]))

Rule 446

Int[(x_)^(m_.)*((a_) + (b_.)*(x_)^(n_))^(p_.)*((c_) + (d_.)*(x_)^(n_))^(q_.), x_Symbol] :> Dist[1/n, Subst[Int
[x^(Simplify[(m + 1)/n] - 1)*(a + b*x)^p*(c + d*x)^q, x], x, x^n], x] /; FreeQ[{a, b, c, d, m, n, p, q}, x] &&
 NeQ[b*c - a*d, 0] && IntegerQ[Simplify[(m + 1)/n]]

Rule 72

Int[((e_.) + (f_.)*(x_))^(p_.)/(((a_.) + (b_.)*(x_))*((c_.) + (d_.)*(x_))), x_Symbol] :> Int[ExpandIntegrand[(
e + f*x)^p/((a + b*x)*(c + d*x)), x], x] /; FreeQ[{a, b, c, d, e, f}, x] && IntegerQ[p]

Rubi steps

\begin{align*} \int \frac{\tan ^5(e+f x)}{a+b \tan ^2(e+f x)} \, dx &=\frac{\operatorname{Subst}\left (\int \frac{x^5}{\left (1+x^2\right ) \left (a+b x^2\right )} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{\operatorname{Subst}\left (\int \frac{x^2}{(1+x) (a+b x)} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac{\operatorname{Subst}\left (\int \left (\frac{1}{b}+\frac{1}{(a-b) (1+x)}-\frac{a^2}{(a-b) b (a+b x)}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac{\log (\cos (e+f x))}{(a-b) f}-\frac{a^2 \log \left (a+b \tan ^2(e+f x)\right )}{2 (a-b) b^2 f}+\frac{\tan ^2(e+f x)}{2 b f}\\ \end{align*}

Mathematica [A]  time = 0.1577, size = 64, normalized size = 0.9 \[ \frac{-\frac{a^2 \log \left (a+b \tan ^2(e+f x)\right )}{b^2 (a-b)}-\frac{2 \log (\cos (e+f x))}{a-b}+\frac{\tan ^2(e+f x)}{b}}{2 f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]^5/(a + b*Tan[e + f*x]^2),x]

[Out]

((-2*Log[Cos[e + f*x]])/(a - b) - (a^2*Log[a + b*Tan[e + f*x]^2])/((a - b)*b^2) + Tan[e + f*x]^2/b)/(2*f)

________________________________________________________________________________________

Maple [A]  time = 0.017, size = 72, normalized size = 1. \begin{align*}{\frac{ \left ( \tan \left ( fx+e \right ) \right ) ^{2}}{2\,fb}}-{\frac{{a}^{2}\ln \left ( a+b \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{ \left ( 2\,a-2\,b \right ){b}^{2}f}}+{\frac{\ln \left ( 1+ \left ( \tan \left ( fx+e \right ) \right ) ^{2} \right ) }{2\,f \left ( a-b \right ) }} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)^5/(a+b*tan(f*x+e)^2),x)

[Out]

1/2*tan(f*x+e)^2/b/f-1/2*a^2*ln(a+b*tan(f*x+e)^2)/(a-b)/b^2/f+1/2/f/(a-b)*ln(1+tan(f*x+e)^2)

________________________________________________________________________________________

Maxima [A]  time = 1.09973, size = 103, normalized size = 1.45 \begin{align*} -\frac{\frac{a^{2} \log \left (-{\left (a - b\right )} \sin \left (f x + e\right )^{2} + a\right )}{a b^{2} - b^{3}} - \frac{{\left (a + b\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right )}{b^{2}} + \frac{1}{b \sin \left (f x + e\right )^{2} - b}}{2 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*(a^2*log(-(a - b)*sin(f*x + e)^2 + a)/(a*b^2 - b^3) - (a + b)*log(sin(f*x + e)^2 - 1)/b^2 + 1/(b*sin(f*x
+ e)^2 - b))/f

________________________________________________________________________________________

Fricas [A]  time = 1.22247, size = 203, normalized size = 2.86 \begin{align*} -\frac{a^{2} \log \left (\frac{b \tan \left (f x + e\right )^{2} + a}{\tan \left (f x + e\right )^{2} + 1}\right ) -{\left (a b - b^{2}\right )} \tan \left (f x + e\right )^{2} -{\left (a^{2} - b^{2}\right )} \log \left (\frac{1}{\tan \left (f x + e\right )^{2} + 1}\right )}{2 \,{\left (a b^{2} - b^{3}\right )} f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*(a^2*log((b*tan(f*x + e)^2 + a)/(tan(f*x + e)^2 + 1)) - (a*b - b^2)*tan(f*x + e)^2 - (a^2 - b^2)*log(1/(t
an(f*x + e)^2 + 1)))/((a*b^2 - b^3)*f)

________________________________________________________________________________________

Sympy [A]  time = 14.1298, size = 348, normalized size = 4.9 \begin{align*} \begin{cases} \tilde{\infty } x \tan ^{3}{\left (e \right )} & \text{for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac{\frac{\log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac{\tan ^{4}{\left (e + f x \right )}}{4 f} - \frac{\tan ^{2}{\left (e + f x \right )}}{2 f}}{a} & \text{for}\: b = 0 \\- \frac{2 \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )} \tan ^{2}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac{2 \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} + \frac{\tan ^{4}{\left (e + f x \right )}}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} - \frac{2}{2 b f \tan ^{2}{\left (e + f x \right )} + 2 b f} & \text{for}\: a = b \\\frac{x \tan ^{5}{\left (e \right )}}{a + b \tan ^{2}{\left (e \right )}} & \text{for}\: f = 0 \\- \frac{a^{2} \log{\left (- i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a b^{2} f - 2 b^{3} f} - \frac{a^{2} \log{\left (i \sqrt{a} \sqrt{\frac{1}{b}} + \tan{\left (e + f x \right )} \right )}}{2 a b^{2} f - 2 b^{3} f} + \frac{a b \tan ^{2}{\left (e + f x \right )}}{2 a b^{2} f - 2 b^{3} f} + \frac{b^{2} \log{\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a b^{2} f - 2 b^{3} f} - \frac{b^{2} \tan ^{2}{\left (e + f x \right )}}{2 a b^{2} f - 2 b^{3} f} & \text{otherwise} \end{cases} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)**5/(a+b*tan(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*tan(e)**3, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), ((log(tan(e + f*x)**2 + 1)/(2*f) + tan(e + f*x)**
4/(4*f) - tan(e + f*x)**2/(2*f))/a, Eq(b, 0)), (-2*log(tan(e + f*x)**2 + 1)*tan(e + f*x)**2/(2*b*f*tan(e + f*x
)**2 + 2*b*f) - 2*log(tan(e + f*x)**2 + 1)/(2*b*f*tan(e + f*x)**2 + 2*b*f) + tan(e + f*x)**4/(2*b*f*tan(e + f*
x)**2 + 2*b*f) - 2/(2*b*f*tan(e + f*x)**2 + 2*b*f), Eq(a, b)), (x*tan(e)**5/(a + b*tan(e)**2), Eq(f, 0)), (-a*
*2*log(-I*sqrt(a)*sqrt(1/b) + tan(e + f*x))/(2*a*b**2*f - 2*b**3*f) - a**2*log(I*sqrt(a)*sqrt(1/b) + tan(e + f
*x))/(2*a*b**2*f - 2*b**3*f) + a*b*tan(e + f*x)**2/(2*a*b**2*f - 2*b**3*f) + b**2*log(tan(e + f*x)**2 + 1)/(2*
a*b**2*f - 2*b**3*f) - b**2*tan(e + f*x)**2/(2*a*b**2*f - 2*b**3*f), True))

________________________________________________________________________________________

Giac [B]  time = 3.18393, size = 622, normalized size = 8.76 \begin{align*} \frac{\frac{2 \,{\left (a + b\right )} \log \left (-\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} - \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} - 2\right )}{b^{2}} - \frac{{\left (a + b\right )} \log \left ({\left | a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )}^{2} - 4 \, b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} - 4 \, a + 8 \, b \right |}\right )}{b^{2}} - \frac{{\left (a^{2} + b^{2}\right )} \log \left (\frac{{\left | -2 \, a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 4 \, b - 4 \,{\left | a - b \right |} \right |}}{{\left | -2 \, a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 4 \, b + 4 \,{\left | a - b \right |} \right |}}\right )}{b^{2}{\left | a - b \right |}} - \frac{2 \,{\left (a{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + b{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1}\right )} + 2 \, a + 6 \, b\right )}}{b^{2}{\left (\frac{\cos \left (f x + e\right ) + 1}{\cos \left (f x + e\right ) - 1} + \frac{\cos \left (f x + e\right ) - 1}{\cos \left (f x + e\right ) + 1} + 2\right )}}}{4 \, f} \end{align*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)^5/(a+b*tan(f*x+e)^2),x, algorithm="giac")

[Out]

1/4*(2*(a + b)*log(-(cos(f*x + e) + 1)/(cos(f*x + e) - 1) - (cos(f*x + e) - 1)/(cos(f*x + e) + 1) - 2)/b^2 - (
a + b)*log(abs(a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1))^2 - 4*b*((cos
(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) - 4*a + 8*b))/b^2 - (a^2 + b^2)*log
(abs(-2*a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 4*b - 4*abs(a - b)
)/abs(-2*a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 4*b + 4*abs(a - b
)))/(b^2*abs(a - b)) - 2*(a*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) +
b*((cos(f*x + e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1)) + 2*a + 6*b)/(b^2*((cos(f*x
+ e) + 1)/(cos(f*x + e) - 1) + (cos(f*x + e) - 1)/(cos(f*x + e) + 1) + 2)))/f